<template>
  <a-drawer
    :title="title"
    :width="width"
    placement="right"
    :closable="false"
    @close="close"
    :visible="visible">
  
    <a-spin :spinning="confirmLoading">
      <a-form :form="form">

        <a-form-item label="编码" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['partCode', validatorRules.partCode]" placeholder="请输入编码"></a-input>
        </a-form-item>
        <a-form-item label="版本号" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['version']" placeholder="请输入版本号"></a-input>
        </a-form-item>
        <a-form-item label="物料名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['partName']" placeholder="请输入物料名称"></a-input>
        </a-form-item>
        <a-form-item label="规格号" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['spec']" placeholder="请输入规格号"></a-input>
        </a-form-item>
        <a-form-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['desp']" placeholder="请输入描述"></a-input>
        </a-form-item>
        <a-form-item label="旧编码" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['oldCode']" placeholder="请输入旧编码"></a-input>
        </a-form-item>
        <a-form-item label="助记码" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['helpcode']" placeholder="请输入助记码"></a-input>
        </a-form-item>
        <a-form-item label="ABC分类" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag type="list" v-decorator="['abcCode']" :trigger-change="true" dictCode="ABCcode" placeholder="请选择ABC分类"/>
        </a-form-item>
        <a-form-item label="图号" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['photoNumber']" placeholder="请输入图号"></a-input>
        </a-form-item>
        <a-form-item label="生效日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-date placeholder="请选择生效日期" v-decorator="['sdate']" :trigger-change="true" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="有效开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-date placeholder="请选择有效开始时间" v-decorator="['starttime']" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="有效结束时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-date placeholder="请选择有效结束时间" v-decorator="['endtime']" :trigger-change="true" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="生产类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag type="list" v-decorator="['makeInfo']" :trigger-change="true" dictCode="make_info" placeholder="请选择生产类型"/>
        </a-form-item>
        <a-form-item label="资源类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag type="list" v-decorator="['zyinfo']" :trigger-change="true" dictCode="zyinfo" placeholder="请选择资源类型"/>
        </a-form-item>
        <a-form-item label="是否可销售" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag type="list" v-decorator="['issell']" :trigger-change="true" dictCode="issell" placeholder="请选择是否可销售"/>
        </a-form-item>
        <a-form-item label="材质" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['material']" placeholder="请输入材质"></a-input>
        </a-form-item>
        <a-form-item label="单重" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['weight']" placeholder="请输入单重"></a-input>
        </a-form-item>
        <a-form-item label="毛重" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['mweight']" placeholder="请输入毛重"></a-input>
        </a-form-item>
        <a-form-item label="系列" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['set1']" placeholder="请输入系列"></a-input>
        </a-form-item>
        <a-form-item label="代号" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['dnumber']" placeholder="请输入代号"></a-input>
        </a-form-item>
        <a-form-item label="模型" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['model']" placeholder="请输入模型"></a-input>
        </a-form-item>
        <a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['memo']" placeholder="请输入备注"></a-input>
        </a-form-item>
        <a-form-item label="是否认证" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag type="list" v-decorator="['ischecked']" :trigger-change="true" dictCode="ischecked" placeholder="请选择是否认证"/>
        </a-form-item>
        <a-form-item label="是否冻结" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag type="list" v-decorator="['status']" :trigger-change="true" dictCode="status" placeholder="请选择是否冻结"/>
        </a-form-item>
        <a-form-item label="基础计量单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag type="list" v-decorator="['baseUnit']" :trigger-change="true" dictCode="base_unit" placeholder="请选择基础计量单位"/>
        </a-form-item>
        <a-form-item label="销售计量单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag type="list" v-decorator="['saleUnit']" :trigger-change="true" dictCode="sale_unit" placeholder="请选择销售计量单位"/>
        </a-form-item>
        <a-form-item label="采购计量单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag type="list" v-decorator="['purseUnit']" :trigger-change="true" dictCode="purse_unit" placeholder="请选择采购计量单位"/>
        </a-form-item>
        <a-form-item label="生产计量单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag type="list" v-decorator="['prodUnit']" :trigger-change="true" dictCode="prod_unit" placeholder="请选择生产计量单位"/>
        </a-form-item>
        <a-form-item label="库存计量单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag type="list" v-decorator="['stockUnit']" :trigger-change="true" dictCode="k_unit" placeholder="请选择库存计量单位"/>
        </a-form-item>
        <a-form-item label="发运计量单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag type="list" v-decorator="['fyUnit']" :trigger-change="true" dictCode="fy_unit" placeholder="请选择发运计量单位"/>
        </a-form-item>
        <a-form-item label="数量辅助计量单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['suppleUnit']" placeholder="请输入数量辅助计量单位"></a-input>
        </a-form-item>
        <a-form-item label="数量辅助计量换算率" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['suppleExchange']" placeholder="请输入数量辅助计量换算率"></a-input>
        </a-form-item>
        <a-form-item label="数量精度" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['smaller']" placeholder="请输入数量精度"></a-input>
        </a-form-item>
        <a-form-item label="重量计量单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag type="list" v-decorator="['weightUnit']" :trigger-change="true" dictCode="weight_unit" placeholder="请选择重量计量单位"/>
        </a-form-item>
        <a-form-item label="物料分类" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['infoId']" placeholder="请输入物料分类"></a-input>
        </a-form-item>
        <a-form-item label="销售重量单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['sweightunit']" placeholder="请输入销售重量单位"></a-input>
        </a-form-item>
        <a-form-item label="外购重量单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['wunit']" placeholder="请输入外购重量单位"></a-input>
        </a-form-item>
        <a-form-item label="生产重量单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['sunit']" placeholder="请输入生产重量单位"></a-input>
        </a-form-item>
        <a-form-item label="库存重量单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['kunit']" placeholder="请输入库存重量单位"></a-input>
        </a-form-item>
        <a-form-item label="重量辅助单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['fzunit']" placeholder="请输入重量辅助单位"></a-input>
        </a-form-item>
        <a-form-item label="重量换算率" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['fzrate']" placeholder="请输入重量换算率"></a-input>
        </a-form-item>
        <a-form-item label="重量精度" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['fzprecision']" placeholder="请输入重量精度"></a-input>
        </a-form-item>
        <a-form-item label="第三计量单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['junit']" placeholder="请输入第三计量单位"></a-input>
        </a-form-item>
        <a-form-item label="销售三量单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['saleunit']" placeholder="请输入销售三量单位"></a-input>
        </a-form-item>
        <a-form-item label="外购三量单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['wsunit']" placeholder="请输入外购三量单位"></a-input>
        </a-form-item>
        <a-form-item label="生产三量单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['msunit']" placeholder="请输入生产三量单位"></a-input>
        </a-form-item>
        <a-form-item label="库存三量单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['ksunit']" placeholder="请输入库存三量单位"></a-input>
        </a-form-item>
        <a-form-item label="发运三量单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['fsunit']" placeholder="请输入发运三量单位"></a-input>
        </a-form-item>
        <a-form-item label="三量辅助单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['ssfunit']" placeholder="请输入三量辅助单位"></a-input>
        </a-form-item>
        <a-form-item label="三量换算率" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['srate']" placeholder="请输入三量换算率"></a-input>
        </a-form-item>
        <a-form-item label="货币单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag type="list" v-decorator="['currency']" :trigger-change="true" dictCode="currency" placeholder="请选择货币单位"/>
        </a-form-item>
        <a-form-item label="销售数量单价" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['price']" placeholder="请输入销售数量单价"></a-input>
        </a-form-item>
        <a-form-item label="销售重量单价" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['price1']" placeholder="请输入销售重量单价"></a-input>
        </a-form-item>
        <a-form-item label="销售第三单价" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['price2']" placeholder="请输入销售第三单价"></a-input>
        </a-form-item>
        <a-form-item label="销售计价方式" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag type="list" v-decorator="['pstyle']" :trigger-change="true" dictCode="price12" placeholder="请选择销售计价方式"/>
        </a-form-item>
        <a-form-item label="标准交货期" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['paydays']" placeholder="请输入标准交货期"></a-input>
        </a-form-item>
        <a-form-item label="标准交货单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['payunit']" placeholder="请输入标准交货单位"></a-input>
        </a-form-item>
        <a-form-item label="外购数量单价" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['wprice']" placeholder="请输入外购数量单价"></a-input>
        </a-form-item>
        <a-form-item label="外购重量单价" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['wwprice']" placeholder="请输入外购重量单价"></a-input>
        </a-form-item>
        <a-form-item label="外购第三单价" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['thirdprice']" placeholder="请输入外购第三单价"></a-input>
        </a-form-item>
        <a-form-item label="外购计价方式" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag type="list" v-decorator="['wjstyle']" :trigger-change="true" dictCode="wgstyle" placeholder="请选择外购计价方式"/>
        </a-form-item>
        <a-form-item label="标准外购周期" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['wgday']" placeholder="请输入标准外购周期"></a-input>
        </a-form-item>
        <a-form-item label="标准外购周期单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['wgunit']" placeholder="请输入标准外购周期单位"></a-input>
        </a-form-item>
        <a-form-item label="生产数量单价" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['madePrice']" placeholder="请输入生产数量单价"></a-input>
        </a-form-item>
        <a-form-item label="生产重量单价" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['madewprice']" placeholder="请输入生产重量单价"></a-input>
        </a-form-item>
        <a-form-item label="生产第三单价" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['madethirdprice']" placeholder="请输入生产第三单价"></a-input>
        </a-form-item>
        <a-form-item label="生产计价方式" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag type="list" v-decorator="['madestyle']" :trigger-change="true" dictCode="madestyle" placeholder="请选择生产计价方式"/>
        </a-form-item>
        <a-form-item label="标准生产周期" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['bmakeday']" placeholder="请输入标准生产周期"></a-input>
        </a-form-item>
        <a-form-item label="标准生产周期单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['bmakeunit']" placeholder="请输入标准生产周期单位"></a-input>
        </a-form-item>
        <a-form-item label="库存数量单价" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['kprice']" placeholder="请输入库存数量单价"></a-input>
        </a-form-item>
        <a-form-item label="库存重量单价" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['kwprice']" placeholder="请输入库存重量单价"></a-input>
        </a-form-item>
        <a-form-item label="库存第三单价" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['kthirdprice']" placeholder="请输入库存第三单价"></a-input>
        </a-form-item>
        <a-form-item label="库存计价方式" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag type="list" v-decorator="['kpricestyle']" :trigger-change="true" dictCode="kpricestyle" placeholder="请选择库存计价方式"/>
        </a-form-item>
        <a-form-item label="标准存放周期" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['rperiod']" placeholder="请输入标准存放周期"></a-input>
        </a-form-item>
        <a-form-item label="标准存放有效单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['runit']" placeholder="请输入标准存放有效单位"></a-input>
        </a-form-item>
        <a-form-item label="最低库存量" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['lowNum']" placeholder="请输入最低库存量"></a-input>
        </a-form-item>
        <a-form-item label="最高库存量" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['heightNum']" placeholder="请输入最高库存量"></a-input>
        </a-form-item>
        <a-form-item label="安全库存量" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['safeNum']" placeholder="请输入安全库存量"></a-input>
        </a-form-item>
        <a-form-item label="批量单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['batchUnit']" placeholder="请输入批量单位"></a-input>
        </a-form-item>
        <a-form-item label="最小批量" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['lbatchNum']" placeholder="请输入最小批量"></a-input>
        </a-form-item>
        <a-form-item label="最大批量" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['hbatchnum']" placeholder="请输入最大批量"></a-input>
        </a-form-item>
        <a-form-item label="主工艺路线" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['processroutes']" placeholder="请输入主工艺路线"></a-input>
        </a-form-item>
        <a-form-item label="批次" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['batch']" placeholder="请输入批次"></a-input>
        </a-form-item>
        <a-form-item label="有效批次" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['ybatch']" placeholder="请输入有效批次"></a-input>
        </a-form-item>
        <a-form-item label="标准成品率" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['productrate']" placeholder="请输入标准成品率"></a-input>
        </a-form-item>
        <a-form-item label="标准损耗率" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['wastgerate']" placeholder="请输入标准损耗率"></a-input>
        </a-form-item>
        <a-form-item label="是否关键件" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag type="list" v-decorator="['ismain']" :trigger-change="true" dictCode="ismain" placeholder="请选择是否关键件"/>
        </a-form-item>
        <a-form-item label="是否专用" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag type="list" v-decorator="['iszy']" :trigger-change="true" dictCode="iszy" placeholder="请选择是否专用"/>
        </a-form-item>
        <a-form-item label="检验等级" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <a-input v-decorator="['primaryStyle']" placeholder="请输入检验等级"></a-input>
        </a-form-item>
        <a-form-item label="可售期开始" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-date placeholder="请选择可售期开始" v-decorator="['salestart']" :trigger-change="true" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="可售期结束" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-date placeholder="请选择可售期结束" v-decorator="['saleend']" :trigger-change="true" style="width: 100%"/>
        </a-form-item>
        <a-form-item label="生产车间" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-popup
            v-decorator="['depart']"
            :trigger-change="true"
            org-fields="部门名称"
            dest-fields="depart"
            code="chejian"
            @callback="popupCallback"/>
        </a-form-item>
        <a-form-item label="客户信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-dict-select-tag type="list" v-decorator="['customer']" :trigger-change="true" dictCode="customer,name,name" placeholder="请选择客户信息"/>
        </a-form-item>
        <a-form-item label="产品缩略图  " :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-image-upload isMultiple v-decorator="['file']"></j-image-upload>
        </a-form-item>
        <a-form-item label="上传附件" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <j-upload v-decorator="['uploadfile']" :trigger-change="true"></j-upload>
        </a-form-item>
        
      </a-form>
    </a-spin>
    <a-button type="primary" @click="handleOk">确定</a-button>
    <a-button type="primary" @click="handleCancel">取消</a-button>
  </a-drawer>
</template>

<script>

  import { httpAction } from '@/api/manage'
  import pick from 'lodash.pick'
  import { validateDuplicateValue } from '@/utils/util'
  import JDate from '@/components/jeecg/JDate'  
  import JUpload from '@/components/jeecg/JUpload'
  import JImageUpload from '@/components/jeecg/JImageUpload'
  import JDictSelectTag from "@/components/dict/JDictSelectTag"
  
  export default {
    name: "BasepartModal",
    components: { 
      JDate,
      JUpload,
      JImageUpload,
      JDictSelectTag,
    },
    data () {
      return {
        form: this.$form.createForm(this),
        title:"操作",
        width:800,
        visible: false,
        model: {},
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },
        confirmLoading: false,
        validatorRules: {
          partCode: {
            rules: [
              { required: true, message: '请输入编码!'},
            ]
          },
        },
        url: {
          add: "/basep/basepart/add",
          edit: "/basep/basepart/edit",
        }
      }
    },
    created () {
    },
    methods: {
      add () {
        this.edit({});
      },
      edit (record) {
        this.form.resetFields();
        this.model = Object.assign({}, record);
        this.visible = true;
        this.$nextTick(() => {
          this.form.setFieldsValue(pick(this.model,'partCode','version','partName','spec','desp','oldCode','helpcode','abcCode','photoNumber','sdate','starttime','endtime','makeInfo','zyinfo','issell','material','weight','mweight','set1','dnumber','model','memo','ischecked','status','baseUnit','saleUnit','purseUnit','prodUnit','stockUnit','fyUnit','suppleUnit','suppleExchange','smaller','weightUnit','infoId','sweightunit','wunit','sunit','kunit','fzunit','fzrate','fzprecision','junit','saleunit','wsunit','msunit','ksunit','fsunit','ssfunit','srate','currency','price','price1','price2','pstyle','paydays','payunit','wprice','wwprice','thirdprice','wjstyle','wgday','wgunit','madePrice','madewprice','madethirdprice','madestyle','bmakeday','bmakeunit','kprice','kwprice','kthirdprice','kpricestyle','rperiod','runit','lowNum','heightNum','safeNum','batchUnit','lbatchNum','hbatchnum','processroutes','batch','ybatch','productrate','wastgerate','ismain','iszy','primaryStyle','salestart','saleend','depart','customer','file','uploadfile','uploadfile1','isbom','iscbom','status12'))
        })
      },
      close () {
        this.$emit('close');
        this.visible = false;
      },
      handleOk () {
        const that = this;
        // 触发表单验证
        this.form.validateFields((err, values) => {
          if (!err) {
            that.confirmLoading = true;
            let httpurl = '';
            let method = '';
            if(!this.model.id){
              httpurl+=this.url.add;
              method = 'post';
            }else{
              httpurl+=this.url.edit;
               method = 'put';
            }
            let formData = Object.assign(this.model, values);
            console.log("表单提交数据",formData)
            httpAction(httpurl,formData,method).then((res)=>{
              if(res.success){
                that.$message.success(res.message);
                that.$emit('ok');
              }else{
                that.$message.warning(res.message);
              }
            }).finally(() => {
              that.confirmLoading = false;
              that.close();
            })
          }
         
        })
      },
      handleCancel () {
        this.close()
      },
      popupCallback(row){
        this.form.setFieldsValue(pick(row,'partCode','version','partName','spec','desp','oldCode','helpcode','abcCode','photoNumber','sdate','starttime','endtime','makeInfo','zyinfo','issell','material','weight','mweight','set1','dnumber','model','memo','ischecked','status','baseUnit','saleUnit','purseUnit','prodUnit','stockUnit','fyUnit','suppleUnit','suppleExchange','smaller','weightUnit','infoId','sweightunit','wunit','sunit','kunit','fzunit','fzrate','fzprecision','junit','saleunit','wsunit','msunit','ksunit','fsunit','ssfunit','srate','currency','price','price1','price2','pstyle','paydays','payunit','wprice','wwprice','thirdprice','wjstyle','wgday','wgunit','madePrice','madewprice','madethirdprice','madestyle','bmakeday','bmakeunit','kprice','kwprice','kthirdprice','kpricestyle','rperiod','runit','lowNum','heightNum','safeNum','batchUnit','lbatchNum','hbatchnum','processroutes','batch','ybatch','productrate','wastgerate','ismain','iszy','primaryStyle','salestart','saleend','depart','customer','file','uploadfile','uploadfile1','isbom','iscbom','status12'))
      }
      
    }
  }
</script>

<style lang="less" scoped>
/** Button按钮间距 */
  .ant-btn {
    margin-left: 30px;
    margin-bottom: 30px;
    float: right;
  }
</style>